/**
 *
 */
package gemini.basic.dao.impl;

import gemini.basic.dao.GmnDao;
import gemini.basic.dao.ProductDetailDao;
import gemini.basic.model.ProductDetail;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

/**
 *
 *
 */
public class ProductDetailDaoImpl extends HibernateDaoSupport implements ProductDetailDao {

	private GmnDao gmnDao;

	public void setGmnDao(GmnDao gmnDao) {
		this.gmnDao = gmnDao;
	}

	@Override
	public ProductDetail saveOrUpdate(ProductDetail productDetail, boolean flush) {
		ProductDetail result = null;
		if (flush) {
			result = (ProductDetail) gmnDao.saveOrUpdateAndFlush(productDetail);
		} else {
			result = (ProductDetail) gmnDao.saveOrUpdate(productDetail);
		}
		return result;
	}
}
